#include <iostream>
#include <string>
#include "./include/mysql.h"

/*
const std::string host = "175.178.70.240";
const std::string user = "root";
const std::string passwd = "984014088";
const std::string db = "tt1";
const int port = 3306;
*/

int main()
{
    std::cout << "mysql client start : " << mysql_get_client_info() << std::endl;

    // 建立句柄
    MYSQL *my = mysql_init(nullptr);

    // 链接数据库
    if (nullptr == mysql_real_connect(my, "175.178.70.240", "root", "984014088", "tt1", 3306, nullptr,  0)){
        std::cerr << "mysql 链接失败" << std::endl;
        return 1;
    }

    std::cout << "链接成功" << std::endl;

    mysql_close(my);
    std::cout << "关闭 mysql" << std::endl;

    return 0;
}
